﻿using gt.webapi.core.Entity.Common;
using System.Web.Http;

namespace gt.webapi.core.Extensions
{
    public class ApiControllerBase : ApiController
    {
        protected internal SuccessResult<string> Success()
        {
            return Success<string>(null);
        }
        protected internal SuccessResult<T> Success<T>(T content)
        {
            return new SuccessResult<T>(content, Request);
        }
        protected internal ErrorResult Error(int errorCode, string errorMsg)
        {
            return new ErrorResult(errorCode, errorMsg, Request);
        }
    }
}
